<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/assets/cashier/css/main.css"/>
    <link rel="stylesheet" href="/assets/cashier/css/iconfont.css">
    <link rel="stylesheet" href="/assets/cashier/css/print.css">	
    <script type="text/javascript" src="/assets/cashier/js/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="/assets/cashier/js/main.js"></script>
    <script type="text/javascript" src="/assets/cashier/js/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="/assets/cashier/js/jquery-migrate-1.2.1.min.js"></script>
    <script type="text/javascript" src="/assets/cashier/js/jedate/jquery.jedate.js"></script>
    <link type="text/css" rel="stylesheet" href="/assets/cashier/js/jedate/skin/jedate.css">
    <title>统计</title>
    <style>
    	table,table tr th, table tr td { border:1px solid #d1d1d1; }
    	.report{
			width: 100%;
			background: #fff;
		}
		.report td{
			text-align: center;
			height: 30px;
			line-height: 30px;
			width:12.5%;
			color: #808080;
		}
		.count-btn{
			margin: 0 5px;
			cursor: pointer;
			color: #00A680;
		}
		.detail{
			padding: 20px;
			border: none;
			width: 80%;
		}
		.detail td{
			text-align: center;
		}
		
		.member-nav ul{
			border-bottom: 1px solid #d1d1d1;
		    height:50px;
		    line-height: 50px;
		    color: #999;
		    font-size: 16px;
		    padding-left: 40px;
		    padding-right: 20px;
		}
		
		.member-nav ul li{
		    float: left;
		    width:110px;
		    height: 49px;
		    text-align: center;
		    cursor: pointer;
		}
		.member-nav ul li.active{
		    color: #51d4a8;
		    border-bottom: 2px solid #51d4a8;
		}
		.member-list{
			width: 100%;
		}
		
		.cashier{
			width: 100%;;	
		}
    </style>
</head>
<body>
    <div class="container">
        <div class="nav">
            <div class="user-head">
                <img src="/assets/logo.png"/>
            </div>
            <div class="nav-con">
                <ul>
                     <li class="nav-list">
                        <a href="/cashier/index/index/index">
                            <span class="iconfont icon-shouyin"></span>
                            <p data-locale="msg_shouyin">收银台</p>
                        </a>
                    </li>
                    <li class="nav-list">
                        <a href="/cashier/index/index/order">
                            <span class="iconfont icon-guadan"></span>
                            <p data-locale="msg_guadan">挂单</p>
                        </a>
                    </li>
                    <li class="nav-list">
                        <a href="/cashier/index/index/members">
	                        <span class="iconfont icon-huiyuan"></span>
	                        <p data-locale="msg_huiyuan">会员</p>
                        </a>
                    </li>
                    <li class="nav-list active">
                        <a href="/cashier/index/index/count">
                            <span class="iconfont icon-tongji"></span>
                            <p data-local="msg_tongji">统计</p>
                        </a>
                    </li>
                    <li class="nav-list">
                        <a href="/cashier/index/index/change">
                            <span class="iconfont icon-tuihuo"></span>
                            <p data-locale="msg_tuihuanhuo">退换货</p>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="nav-foot">
                <div class="nav-foot-list nav-lock">
                    <span class="iconfont icon-suo"></span>
                    <p data-locale="suoding">锁定</p>
                </div>
                <div class="nav-foot-list nav-cancel">
                    <a href="/cashier/index/index/exchange">
                        <span class="iconfont icon-tuichu"></span>
                        <p data-locale="msg_jiaoban">交班</p>
                    </a>
                </div>
            </div>
        </div>
        <div class="content" style="padding-right: 25px">
            <table class="report" rules="rows"  border="1" id="tb1">
				<tbody>
					<tr >
						<td>收银员:<span class="casher"></span></td>
						<td colspan="6">工作时间:<span class="work-time"></span></td>
						<td class="cashier-print count-btn" style="color: #00A680;">打印</td>
					</tr>
					<tr>
						<td colspan="2">实际总收入</td>
						<td colspan="2">总销售额</td>
						<td colspan="2">总会员充值</td>
						<td colspan="2">总退货金额</td>
					</tr>
					<tr>
						<td colspan="2" class="allMoney"></td>
						<td colspan="2" class="allSales"></td>
						<td colspan="2" class="allRecharge"></td>
						<td colspan="2" class="allRefund"></td>
					</tr>
					<tr>
						<td>现金总收入</td>
						<td class="pay-mode-list cash" data-id="1"></td>
						<td>现金支付</td>
						<td class="sale-mode-list" data-id="1"></td>
						<td>现金支付</td>
						<td class="vip-mode-list" data-id="1"></td>
						<td>现金退款</td>
						<td class="refund-mode-list" data-id="1"></td>
					</tr>
					<tr>
						<td>银行卡总收入</td>
						<td class="pay-mode-list bank" data-id="6"></td>
						<td>银行卡支付</td>
						<td class="sale-mode-list sale-bank" data-id="6"></td>
						<td>银行卡支付</td>
						<td class="vip-mode-list vip-bank" data-id="6"></td>
						<td>银行卡退款</td>
						<td class="refund-mode-list refund-bank" data-id="6"></td>
					</tr>
					<tr>
						<td>PayM总收入</td>
						<td class="pay-mode-list paym" data-id="5"></td>
						<td>PayM支付</td>
						<td class="sale-mode-list sale-paym" data-id="5"></td>
						<td>PayM支付</td>
						<td class="vip-mode-list vip-paym" data-id="5"></td>
						<td>PayM退款</td>
						<td class="refund-mode-list refund-paym" data-id="5"></td>
					</tr>
					<tr>
						<td>Paypal总收入</td>
						<td class="pay-mode-list paypal" data-id="4"></td>
						<td>Paypal支付</td>
						<td class="sale-mode-list sale-paypal" data-id="4"></td>
						<td>Paypal支付</td>
						<td class="vip-mode-list vip-paypal" data-id="4"></td>
						<td>Paypal退款</td>
						<td class="refund-mode-list refund-paypal" data-id="4"></td>
					</tr>
					<tr>
						<td>会员卡总收入</td>
						<td class="pay-mode-list vip" data-id="0"></td>
						<td>会员卡支付</td>
						<td class="sale-mode-list sale-vip" data-id="0"></td>
						<td></td>
						<td ></td>
						<td>会员卡退款</td>
						<td class="refund-mode-list addTr refund-vip" data-id="0"></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td>VAT</td>
						<td class="total-vat"></td>
						<td>订单数量</td>
						<td class="total-orders"></td>
						<td>新增会员</td>
						<td class="new-vip"></td>
						<td>货损商品</td>
						<td class="destory-shop"></td>
					</tr>
					<tr>
						<td colspan="2"></td>
						<td>商品数量</td>
						<td class="total-shops"></td>
						<td>新增充值金额</td>
						<td class="new-recharge-vip"></td>
						<td>退货商品</td>
						<td class="refund-shop"></td>
					</tr>
					<tr>
						<td colspan="4"></td>
						<td>会员消费人数</td>
						<td class="vip-number"></td>
						<td colspan="2"></td>
					</tr>
					
				</tbody>
			</table>
			<div class="count-body">
                <div class="table-head">
                    <div class="table-nav">
                        <ul>
                            <li class="active table-nav-list" data-locale="msg_order">订单</li>
                            <li class="table-nav-list" data-locale="msg_huiyuan">会员</li>
                            <li class="table-nav-list" data-locale="msg_tuihuo">退货</li>
                        </ul>
                    </div>
                    <div class="pull-right" style="margin-top: 20px">
                        <input type="text" name="date" class="count-input" placeholder="日期" id="table-date">
                        <input type="text" name="phone" class="count-input" placeholder="单号或会员手机号" id="table-key">
                        <div class="search-table btn btn-active pull-left" style="width: 60px;height: 40px;line-height: 40px" data-locale="msg_search">搜索</div>
                    </div>
                </div>
                <div class="table">
                    <table class="table-list check-list" id="order-table" rules="rows" style="border-color: #d1d1d1;">
                        <thead>
                            <tr>
                                <td class="text-center" data-locale="msg_orderId">订单号</td>
                                <td class="text-center" data-locale="msg_date">日期</td>
                                <td class="text-center" data-locale="msg_huiyuan">会员</td>
                                <td class="text-center" data-locale="msg_paytype">支付方式</td>
                                <td class="text-center" data-locale="msg_zje">消费金额</td>
                                <td class="text-center" data-locale="msg_yhje">优惠金额</td>
                                <td class="text-center" data-locale="msg_yunfei">运费</td>
                                <td class="text-center" >支付金额</td>
                                <td class="text-center" >当前余额</td>
                                <td class="text-center" >VAT</td>
                                <td class="text-center" >经手收银员</td>
                                <td class="text-center" >操作</td>
                            </tr>
                        </thead>
                        <tbody> </tbody>
                        <tfoot>
                        	<tr  style="height: 70px;"><td colspan="12" class="text-center"></td></tr>
                        </tfoot>
                    </table>
                    <div class="members-content table-list hide">
	                    <div class="member-nav">
	                        <ul>
	                            <li class="active member-nav-list" data-locale="msg_order">基本信息</li>
	                            <li class="member-nav-list" data-locale="msg_huiyuan">会员充值</li>
	                            <li class="member-nav-list" data-locale="msg_tuihuo">会员消费/退货</li>
	                        </ul>
	                    </div>
		              	<div class="member-table-con">
		                    <table class="member-list check-list" id="member-detail" rules="rows" style="border-color: #d1d1d1">
		                        <thead>
		                        <tr>
		                            <td class="text-center" >会员姓名</td>
		                            <td class="text-center" >会员卡号</td>
		                            <td class="text-center" >当前余额</td>
		                            <td class="text-center" >微信</td>
		                            <td class="text-center" >地址</td>
		                            <td class="text-center" >邮编</td>
		                            <td class="text-center" >邮箱</td>
		                            <td class="text-center">最近充值/消费/退货订单号</td>
		                            <td class="text-center" >最近使用日期</td>
		                            <td class="text-center" >经手收银员</td>
		                            <td class="text-center" >操作</td>
		                        </tr>
		                        </thead>
		                        <tbody></tbody>
		                        <tfoot><tr  style="height: 70px;"><td colspan="11" class="text-center"></td></tr></tfoot>
		                    </table>
		                    <table class="member-list hide check-list" id="member-recharge" rules="rows" style="border-color: #d1d1d1">
		                        <thead>
		                        <tr>
		                            <td class="text-center" data-locale="msg_viptype">类型</td>
		                            <td class="text-center" data-locale="msg_hyxm">会员姓名</td>
		                            <td class="text-center" data-locale="msg_phone">会员卡号</td>
		                            <td class="text-center" data-locale="msg_jine">上次余额</td>
		                            <td class="text-center" data-locale="msg_hyye">本次充值</td>
		                            <td class="text-center" data-locale="msg_hyye">赠送金额</td>
		                            <td class="text-center" data-locale="msg_paytype">当前余额</td>
		                            <td class="text-center" data-locale="msg_time">付款方式</td>
		                            <td class="text-center" data-locale="msg_hyye">日期</td>
		                            <td class="text-center" data-locale="msg_paytype">经手收银员</td>
		                            <td class="text-center" data-locale="msg_time">操作</td>
		                        </tr>
		                        </thead>
		                        <tbody></tbody>
		                        <tfoot><tr  style="height: 70px;"><td colspan="10" class="text-center"></td></tr></tfoot>
		                    </table>
		                    <table class="member-list hide check-list" id="member-refund" rules="rows" style="border-color: #d1d1d1">
	                        <thead>
	                        <tr>
	                            <td class="text-center" data-locale="msg_viptype">类型</td>
	                            <td class="text-center" data-locale="msg_hyxm">会员姓名</td>
	                            <td class="text-center" data-locale="msg_phone">会员卡号</td>
	                            <td class="text-center" data-locale="msg_jine">上次余额</td>
	                            <td class="text-center" data-locale="msg_hyye">消费/退货金额</td>
	                            <td class="text-center" data-locale="msg_paytype">当前余额</td>
	                            <td class="text-center" data-locale="msg_time">订单号</td>
	                            <td class="text-center" data-locale="msg_hyye">日期</td>
		                        <td class="text-center" data-locale="msg_paytype">经手收银员</td>
		                        <td class="text-center" data-locale="msg_time">操作</td>
	                        </tr>
	                        </thead>
	                        <tbody></tbody>
	                        <tfoot><tr  style="height: 70px;"><td colspan="10" class="text-center"></td></tr></tfoot>
	                    </table>
	                    </div>
                    </div>
                    <table class="table-list hide check-list return" id="return-table" rules="rows" style="border-color: #d1d1d1">
                        <thead>
                        <tr>
                        	<td class="text-center" data-locale="msg_spmc">退货单号</td>
                            <td class="text-center" data-locale="msg_orderId">日期</td>
                            <td class="text-center" data-locale="msg_date">会员</td>
                            <td class="text-center" data-locale="msg_huiyuan">退款方式</td>
                            <td class="text-center" data-locale="msg_thsl">退款金额</td>
                            <td class="text-center" data-locale="msg_tkje">上次余额</td>
                            <td class="text-center" data-locale="msg_tkje">当前余额</td>
                            <td class="text-center" data-locale="msg_tkfs">VAT</td>
                            <td class="text-center" data-locale="msg_isDamaged">是否货损</td>
                            <td class="text-center" data-locale="msg_tkfs">经手收银员</td>
                            <td class="text-center" data-locale="msg_tkfs">操作</td>
                        </tr>
                        </thead>
                        <tbody> </tbody>
                        <tfoot><tr  style="height: 70px;"><td colspan="11" class="text-center"></td></tr></tfoot>
                    </table>
                </div>
            </div>
		</div>
		<div class="popbg">
			<div id="online" class="print-online">
	        	<div class="code"><img src="../../../assets/logo.png"/></div>
				<div class="title">日出行中国超市</div>
				<div class="en-title">Sunrise Chinese Market Ltd</div>
				<div class="address">
					<p>84 Colman Road, Norwich, NR4 7EH</p>		
					<p>01603 927952	</p>	
				</div>
				
				<div class="line-type"><span class="pull-left">ON-LINE</span><span class="pull-right">顾客线上消费送货小票</span></div>
				<div class="print-list">送货时间：<span class="delivery-time"></span></div>
				<div class="print-list">收银员工：<span class="cashier-name"></span></div>
				<div class="print-list">消费时间：<span class="order-time"></span></div>
				<div class="print-list">线上订单：<span class="order_id"></span></div>
				
				<div class="print-list vip-name-box">会员姓名：<span class="vip-name"></span></div>
				<div class="print-list">微信号码：<span class="vip-weixin"></span></div>
				<div class="print-list">送货地址：<span class="vip-address"></span></div>
				<div class="print-list">送货邮编：<span class="vip-site"></span></div>
				<div class="print-list">联系电话：<span class="vip-phone"></span></div>
				<div class="print-list">备注：<span class="vip-remark"></span></div>
				<div class="print-list">支付方式：<span class="print-order-payMode"></span></div>
				<div class="line"></div>
				<div class="print-table-head">
					<span>单价(￡)</span>
					<span>数量</span>
					<span>金额(￡)</span>
				</div>
				<div class="line"></div>
				<div class="print-table-body"> </div>
				<div class="line"></div>
				<div class="print-table-head">
					<span>共计</span>
					<span class="print-table-total-food"></span>
					<span class="print-table-total-price"></span>
				</div>
				<div class="line"></div>
				<div class="consumption"></div>
				
				<div class="line"></div>
				<div class="print-list text-center">VAT RECEIPT SUMMARY</div>
				<div class="print-list text-center">NET：<span class="vat-net"></span></div>
				<div class="print-list text-center">20%VAT：<span class="vat-20"></span></div>
				<div class="print-list text-center">GROSS：<span class="vat-gross"></span></div>
				<div class="print-list text-center">VAT No. : 157965263</div>
				<div class="line"></div>
				<div class="print-time">打印时间：<span class="print-time-detail"></span></div>
				<div class="print-time">感谢惠顾，期待您的再次光临</div>
				<div class="print-time">加入会员，更多折扣，更多优惠，更多方便</div>
				<div class="print-time">扫我↓</div>
				<div class="code"> <img src="../../../assets/cashier/img/richubao.jpg" /></div>
			</div>
			<div id="printer">
				<div class="code"><img src="../../../assets/logo.png"/></div>
				<div class="title">日出行中国超市</div>
				<div class="en-title">Sunrise Chinese Market Ltd</div>
				<div class="address">
					<p>84 Colman Road, Norwich, NR4 7EH</p>		
					<p>01603 927952	</p>	
				</div>
				<div class="print-cashier hide print-item">
					<div class="line-type"><span class="pull-left offline">OFFLINE</span><span class="pull-right">收银员线下结账小票</span></div>
					<div class="print-list">收银员工：<span class="cashier-name"></span></div>
					<div class="print-list">工作时间：<span class="cashier-time"></span></div>
					<div class="print-list">VAT：<span class="totalVat"></span></div>
					<div class="line"></div>
					<div class="print-list" style="font-weight: bold;">实际总收入<span class="totalMoney pull-right">1233</span></div>
					<div class="print-list">现金总收入<span class="pay-mode-list pull-right" data-id="1"></span></div>
					<div class="print-list">银行卡总收入<span class="pay-mode-list pull-right" data-id="6"></span></div>
					<div class="print-list">payM总收入<span class="pay-mode-list pull-right" data-id="5"></span></div>
					<div class="print-list">payPal总收入<span class="pay-mode-list pull-right" data-id="4"></span></div>
					<div class="print-list">会员卡总收入<span class="pay-mode-list pull-right" data-id="0"></span></div>
					<div class="line"></div>
					<div class="print-list" style="font-weight: bold;">总销售额<span class="totalSale pull-right"></span></div>
					<div class="print-list">现金支付<span class="sale-mode-list pull-right" data-id="1"></span></div>
					<div class="print-list">银行卡支付<span class="sale-mode-list pull-right" data-id="6"></span></div>
					<div class="print-list">payM支付<span class="sale-mode-list pull-right" data-id="5"></span></div>
					<div class="print-list">payPal支付<span class="sale-mode-list pull-right" data-id="4"></span></div>
					<div class="print-list">会员卡支付<span class="sale-mode-list pull-right" data-id="0"></span></div>
					<div class="line"></div>
					<div class="print-list" style="font-weight: bold;">总会员充值<span class="totalRecharge pull-right"></span></div>
					<div class="print-list">现金支付<span class="vip-mode-list rechargeCash pull-right" data-id="1"></span></div>
					<div class="print-list">银行卡支付<span class="vip-mode-list rechargeBank pull-right" data-id="6"></span></div>
					<div class="print-list">payM支付<span class="vip-mode-list rechargePaym pull-right" data-id="5"></span></div>
					<div class="print-list">payPal支付<span class="vip-mode-list rechargePaypal pull-right" data-id="4"></span></div>
				
					<div class="line"></div>
					<div class="print-list" style="font-weight: bold;">总退货金额<span class="totalRefund pull-right"></span></div>
					<div class="print-list">现金退款<span class="refund-mode-list refundCash pull-right" data-id="1"></span></div>
					<div class="print-list">银行卡退款<span class="refund-mode-list refundBank pull-right" data-id="6"></span></div>
					<div class="print-list">payM退款<span class="refund-mode-list refundPaym pull-right" data-id="5"></span></div>
					<div class="print-list">payPal退款<span class="refund-mode-list refundPaypal pull-right" data-id="4"></span></div>
					<div class="print-list">会员卡退款<span class="refund-mode-list refundVip pull-right" data-id="0"></span></div>
					<div class="line"></div>
					<div class="print-list">订单数量<span class="totalShop pull-right"></span></div>
					<div class="print-list">商品数量<span class="totalOrder pull-right"></span></div>
					<div class="print-list">会员消费人数<span class="vipNumber pull-right"></span></div>
					<div class="print-list">新增会员<span class="newVip pull-right"></span></div>
					<div class="print-list">新增充值金额<span class="newRecharge pull-right"></span></div>
					<div class="print-list">货损商品<span class="destoryShop pull-right"></span></div>
					<div class="print-list">退货商品<span class="refundShop pull-right"></span></div>
					<div class="line"></div>
					<div class="print-time">打印时间：<span class="print-time-detail"></span></div>
					<div class="print-list">收银员签字 ：</span></div>
					<div class="print-list">经理签字：</div>
				</div>
				<div class="print-order hide print-item">
					<!--<div class="line-type"><span class="pull-left offline">OFFLINE</span><span class="pull-right">顾客线下消费小票</span></div>
					<div class="print-list">收银员工：<span class="cashier-name"></span></div>
					<div class="print-list">消费时间：<span class="order-time"></span></div>
					<div class="print-list">线下订单：<span class="order_id"></span></div>-->
					<div class="offline">
						<div class="line-type"><span class="pull-left">OFFLINE</span><span class="pull-right">顾客线下消费小票</span></div>
						<div class="print-list">收银员工：<span class="cashier-name"></span></div>
						<div class="print-list">消费时间：<span class="order-time"></span></div>
						<div class="print-list">线下订单：<span class="order_id"></span></div>
					</div>
					<div class="online hide">
						<div class="line-type"><span class="pull-left">ON-LINE</span><span class="pull-right">顾客线上消费送货小票</span></div>
						<div class="print-list">送货时间：<span class="delivery-time"></span></div>
						<div class="print-list">收银员工：<span class="cashier-name"></span></div>
						<div class="print-list">消费时间：<span class="order-time"></span></div>
						<div class="print-list">线上订单：<span class="order_id"></span></div>
					</div>
					<div class="print-list vip-name-box">会员姓名：<span class="vip-name"></span></div>
					<div class="print-list">微信号码：<span class="vip-weixin"></span></div>
					<div class="print-list">送货地址：<span class="vip-address"></span></div>
					<div class="print-list">送货邮编：<span class="vip-site"></span></div>
					<div class="print-list">联系电话：<span class="vip-phone"></span></div>
					<div class="print-list">支付方式：<span class="print-order-payMode"></span></div>
					<div class="line"></div>
					<div class="print-table-head">
						<span>单价(￡)</span>
						<span>数量</span>
						<span>金额(￡)</span>
					</div>
					<div class="line"></div>
					<div class="print-table-body"></div>
					<div class="line"></div>
					<div class="print-table-head">
						<span>共计</span>
						<span class="print-table-total-food"></span>
						<span class="print-table-total-price"></span>
					</div>
					<div class="line"></div>
					<div class="consumption"></div>
					
					<div class="line"></div>
					<div class="print-list text-center">VAT RECEIPT SUMMARY</div>
					<div class="print-list text-center">NET：<span class="vat-net"></span></div>
					<div class="print-list text-center">20%VAT：<span class="vat-20"></span></div>
					<div class="print-list text-center">GROSS：<span class="vat-gross"></span></div>
					<div class="print-list text-center">VAT No. : 157965263</div>
					<div class="line"></div>
					<div class="print-time">打印时间：<span class="print-time-detail"></span></div>
					<div class="print-time">感谢惠顾，期待您的再次光临</div>
					<div class="print-time">加入会员，更多折扣，更多优惠，更多方便</div>
					<div class="print-time">扫我↓</div>
					<div class="code"><img src="../../../assets/cashier/img/richubao.jpg" /></div>
				</div>
				<div class="print-recharge print-item hide">
					<div class="line-type"><span class="pull-left offline">OFFLINE</span><span class="pull-right">顾客线下充值小票</span></div>
					<div class="print-list">收银员工：<span class="cashier-name"></span></div>
					<div class="print-list">充值时间：<span class="recharge-time"></span></div>
					<div class="print-list">会员姓名：<span class="recharge-name"></span></div>
					<div class="print-list">会员微信：<span class="recharge-weixin"></span></div>
					<div class="print-list">会员电话：<span class="recharge-phone"></span></div>
					<div class="print-list">充值方式：<span class="print-recharge-payMode"></span></div>
					
					<div class="print-list">上次余额：<span class="last-balance"></span></div>
					<div class="print-list" >本次充值：<span class="recharge-money"></span></div>
					<div class="print-list" >赠送金额：<span class="present-money"></span></div>
					<div class="print-list" >当前余额：<span class="now-balance"></span></div>
					<div class="line"></div>
					<div class="print-time">打印时间：<span class="print-time-detail"></span></div>
					<div class="print-time">感谢惠顾，期待您的再次光临</div>
					<div class="print-time">加入会员，更多折扣，更多优惠，更多方便</div>
					<div class="print-time">扫我↓</div>
					<div class="code"><img src="../../../assets/cashier/img/richubao.jpg" /></div>
				</div>
				<div class="print-refund print-item hide">
					<div class="line-type"><span class="pull-left offline">OFFLINE</span><span class="pull-right">顾客线下退货小票</span></div>
					<div class="print-list">收银员工：<span class="cashier-name"></span></div>
					<div class="print-list">退货时间：<span class="refund-time"></span></div>
					<div class="print-list">线下退货：<span class="refund-id"></span></div>
					<div class="print-list">退货备注：<span class="refund-remark"></span></div>
					<div class="print-list vip-name-box">会员姓名：<span class="vip-name"></span></div>
					<div class="print-list">微信号码：<span class="vip-weixin"></span></div>
					<div class="print-list">送货地址：<span class="vip-address"></span></div>
					<div class="print-list">送货邮编：<span class="vip-site"></span></div>
					<div class="print-list">联系电话：<span class="vip-phone"></span></div>
					<div class="print-list">退款方式：<span class="print-refund-payMode"></span></div>
					<div class="line"></div>
					<div class="print-table-head">
						<span>单价(￡)</span>
						<span>数量</span>
						<span>是否货损</span>
						<span>金额(￡)</span>
					</div>
					<div class="line"></div>
					<div class="print-table-body"></div>
					<div class="line"></div>
					<div class="print-table-head">
						<span>共计</span>
						<span class="print-table-total-food"></span>
						<span class="print-table-total-price"></span>
					</div>
					<div class="line"></div>
					<div class="consumption"></div>
					
					<div class="line"></div>
					<div class="print-list text-center">VAT RECEIPT SUMMARY</div>
					<div class="print-list text-center">NET：<span class="vat-net"></span></div>
					<div class="print-list text-center">20%VAT：<span class="vat-20"></span></div>
					<div class="print-list text-center">GROSS：<span class="vat-gross"></span></div>
					<div class="print-list text-center">VAT No. : 157965263</div>
					<div class="line"></div>
					<div class="print-time">打印时间：<span class="print-time-detail"></span></div>
					<div class="print-time">感谢惠顾，期待您的再次光临</div>
					<div class="print-time">加入会员，更多折扣，更多优惠，更多方便</div>
					<div class="print-time">扫我↓</div>
					<div class="code"><img src="../../../assets/cashier/img/richubao.jpg" /></div>
				</div>
			</div>
			 <!--锁定-->
	        <div class="popbox" id="lock">
	            <div class="pop-head" data-locale="msg_qxsd">请填写你的密码取消锁定</div>
	            <div class="pop-body">
	                <input class="lock-input" name="password">
	            </div>
	            <div class="pop-foot">
	                <div class="centerButton lock-btn" data-locale="msg_queren">确认</div>
	            </div>
	        </div>
        </div>
    </div>
    
    <script type="text/javascript">

        $(function () {
			lock();
			$('#table-date').attr('placeholder',lang('COUNT_DATE'))
			$('#table-key').attr('placeholder',lang('COUNT_OEDER_AND_PHONE'))
			
            $('.table-nav-list').click(function () {
                var index=$(this).index();
                var table=$('.table-list');
                $('.table-list').eq(index).show().siblings().hide();
                $(this).addClass('active').siblings().removeClass('active');
            });
            
            $("#table-date").jeDate({
                format:"YYYY-MM-DD",
                isTime:false
            });
            
            //收银员打印
			$('.cashier-print').on('click',function(){
				$('.print-time-detail').html(getTime())
				$('#printer').show().siblings().hide();
				$('.print-cashier').show().siblings('.print-item').hide();
				$('#printer').jqprint();
				
				
			})
		     $('.table-nav-list').click(function () {
                var index=$(this).index();
                $('.table-list').eq(index).show().siblings().hide();
                $(this).addClass('active').siblings().removeClass('active');
            });
            $('.member-nav-list').click(function () {
                var index=$(this).index();
                $('.member-list').eq(index).show().siblings().hide();
                $(this).addClass('active').siblings().removeClass('active');
            });
	           
			    getCount()
			    function getCount(){
			    	$.ajax({
			    		type:'GET',
	                    data:'',
	                    dataType:'json',
	                    url:urlHead+'/statistic/index',
	                    success:function (json) {
	                    	console.log(json)
	                    	
	                    	var now=new Date();
	                    	var hour=now.getHours();
	                    	var minute=now.getMinutes();
	                    	var workTime=json.begin_time.substr(0,16);
	                    	workTime=workTime+'-'+toAdd(hour)+':'+toAdd(minute);
	                    	
	                    	var incomeMoney=json.income_groups;//总收入
	                    	var orderMoney=json.sale_groups;//订单支付方式金额
                        	var chargeMoney=json.recharge_groups;//会员支付方式金额
                        	var refundMoney=json.refund_groups;//退款
                        	
	                    	
	                    	$('.pay-mode-list').each(function(){
	                    		var id=$(this).attr('data-id');
	                        	$(this).html(0);
	                        	var that=this; 
	                        	$.each(incomeMoney,function(i,list){
	                        		if(id == Number(list.pay_mode)){
	                        			$(that).html(list.num)
	                        		}
	                        	})
	                    	});
	                    	
	                    	$('.sale-mode-list').each(function(){
	                    		var id=$(this).attr('data-id');
	                        	$(this).html(0);
	                        	var that=this; 
	                        	$.each(orderMoney,function(i,list){
	                        		if(id == Number(list.pay_mode)){
	                        			$(that).html(Math.abs(list.num))
	                        		}
	                        		
	                        	})
	                    	});
	                    	
	                    	$('.vip-mode-list').each(function(){
	                    		var id=$(this).attr('data-id');
	                        	$(this).html(0);
	                        	var that=this;
	                        	$.each(chargeMoney,function(i,list){
	                        		if(id == Number(list.pay_mode)){	
	                        			$(that).html(list.num)
	                        		}
	                        	})
	                    	})
	                    	
	                    	$('.refund-mode-list').each(function(){
	                    		var id=$(this).attr('data-id');
	                        	$(this).html(0);
	                        	var that=this;
	                        	$.each(refundMoney,function(i,list){
	                        		if(id == Number(list.pay_mode)){
	                        			$(that).html(list.num);
	                        		}
	                        	})
	                    	});
                  	
	                    	$('.casher,.cashier-name').html(json.cashier.username);
	                    	$('.work-time,.cashier-time').html(workTime);
	                    	$('.allMoney,.totalMoney').html(json.total_income);
	                    	$('.allSales,.totalSale').html(json.total_sale)
	                    	$('.allRecharge,.totalRecharge').html(json.total_recharge)
	                    	$('.allRefund,.totalRefund').html(json.total_refund);
	                    	

	                    	
	                    	$('.total-vat,.totalVat').html(json.vat)
	                    	$('.total-orders,.totalOrder').html(json.order_counts);
	                    	$('.total-shops, .totalShop').html((json.item_counts*1).toFixed(2));
	                    	$('.new-vip, .newVip').html(json.reg_user);
	                    	$('.new-recharge-vip,.newRecharge').html(json.reg_money);
	                    	$('.vip-number, .vipNumber').html(json.xiaofei_user);
	                    	$('.destory-shop, .destoryShop').html(json.huosun);
	                    	$('.refund-shop,.refundShop').html(json.tuihuo)
	                    }
			    	})
			    }
			    
			     //search
	            $('.search-table').click(function(){
	            	var index=0;
	            	var i=0;
	            	var date=$('#table-date').val();
	            	keyword=$('#table-key').val();
	            	$('.table-nav ul li.table-nav-list').each(function(){
	            		if($(this).hasClass('active')){
	            			index=$(this).index();
	            			if(index == 0){
	            				order_date=date;
	            				getOrder();
	            			}else if(index == 1){
	            				$('.member-nav .member-nav-list').each(function(){
	            					if($(this).hasClass('active')){
	            						i=$(this).index();
	            						if(i==0){
	            							vip_date=date;
	            							getVip();
	            						}else if(i==1){
	            							recharge_date=date;
	            							getCharge();
	            						}else {
	            							refund_date=date;
	            							getRefund();
	            						}
	            					}
	            				})
	            				
	            			}else if(index == 2){
	            				return_date=date;
	            				getReturn();
	            			}
	            		}
	            	})
	            })
			   
			    //order
			    var ismy=1,keyword='',order_date='',order_page=1,order_total_page=1;
	            getOrder()
	            $('body').on('click','#order-table .page-next',function(){
	                if (parseInt(order_page)+1 <= order_total_page) {
	                   order_page++;
	                   getOrder();
	                }
	            });
	             $('body').on('click','#order-table .page-prev',function(){
	                if (parseInt(order_page)-1 > 0) {
	                    order_page -= 1;
	                    getOrder();
	                }
	            });
	            $('body').on('click','#order-table .page-target',function(){
	                order_page = parseInt($(this).html());
	                getOrder();
	            });
	          
	            $('body').on('click','.order-check',function(){
					check(this)
	            })
	            
	            $('body').on('click','#order-table .order-print',function(){
					
	            	var order=$(this).attr('data-order');
	            	var refund=$(this).attr('data-refund');
	            	$('#printer').show().siblings().hide();
	            	$('.print-order').show().siblings('.print-item').hide()
	            	orderPrint(order)
	            })
	            function getOrder(){
	            	var params={is_my:ismy,keyword:keyword,date:order_date,page:order_page}
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		data:params,
	            		url:urlHead+'/order/get_orders',
	            		success:function(json){
	            			var page=json.current_page;
	                        var total=json.last_page;
	                        order_total_page = json.last_page;
	                        var page_size=json.page_size;
	                        var orders=json.data;
	                        
	            			console.log(json)
	            			var tr=''
	            			$.each(orders, function(index,item) {
	            			  var user = lang('COUNT_ORDER_USER');
	                          if(item.nickname) user = item.nickname;
	                          if(item.first_name && item.last_name) user = item.first_name+' '+item.last_name;
	                          var paymode = SITE_CONFIG.pay_types[0][SITE_LANG]+'('+item.money+')';
	                          if(item.money == 0) paymode = '';
	                          if(item.pay_mode>0) paymode+= SITE_CONFIG.pay_types[item.pay_mode][SITE_LANG]+'('+(item.total-item.cut_fee-item.money).toFixed(2)+')'; 
	                          var deal=(parseFloat(item.total-item.cut_fee)+parseFloat(item.shipping_fee)).toFixed(2);
	                          
	            			  tr+='<tr class="list-tr" >'
	            			    +'<td class="text-center">'+item.order_id+'</td>'
	                            +    '<td class="text-center">'+item.create_time+'</td>'
	                            +    '<td class="text-center">'+user+'</td>'
	                            +    '<td class="text-center">'+paymode+'</td>'
	                            +    '<td class="text-center">'+item.total+'</td>'
	                            +    '<td class="text-center">'+item.cut_fee+'</td>'
	                            +    '<td class="text-center">'+item.shipping_fee+'</td>'
	                            +    '<td class="text-center">'+deal+'</td>'
	                            +    '<td class="text-center">'+(item.balance>0?item.balance:0)+'</td>'
	                            +    '<td class="text-center">'+item.vat+'</td>'
	                            +    '<td class="text-center">'+item.cashier_name+'</td>'
	                            +    '<td class="text-center"><span class="order-check count-btn" data-order="'+item.order_id+'" isCheck="0">查看</span><span class="order-print count-btn" data-order="'+item.order_id+'" data-refund="'+item.have_refund+'">打印</span></td>'
	                            +	'</tr>'
	            			});
	            			
	                        $('#order-table tbody').html(tr); 
	                        if(parseInt(total)>1){
	                        	var pageHtml=paginate(total,page);
	                            $('#order-table tfoot tr td').html(pageHtml);
	                        }else{
	                        	$('#order-table tfoot tr td').html('');
	                        }
	            		}
	            	})
	            }
	            
	            
	            //会员
	            //1会员详情
             	var vip_date='',vip_page=1,vip_total_page=1;
	            getVip()
	            $('body').on('click','#member-detail .page-next',function(){
	                if (parseInt(vip_page)+1 <= vip_total_page) {
	                   vip_page++;
	                   getVip()
	                }
	            });
	            $('body').on('click','#member-detail .page-prev',function(){
	                if (parseInt(vip_page)-1 > 0) {
	                    vip_page -= 1;
	                    getVip()
	                }
	            });
	            $('body').on('click','#member-detail .page-target',function(){
	                vip_page = parseInt($(this).html());
	               getVip()
	            });
	            function getVip(){
	            	var params={keyword:keyword,date:vip_date,page:vip_page}
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		data:params,
	            		url:urlHead+'/order/get_users',
	            		success:function(json){
	            			var page=json.current_page;
	                        var total=json.last_page;
	                        vip_total_page = json.last_page;
	                        var page_size=json.page_size;
	                       
	            			console.log(json)
	            			var tr=''
	            			$.each(json.data, function(index,item) {
	            			  var user = lang('COUNT_ORDER_USER');
	                          if(item.nickname) user = item.nickname;
	                          if(item.first_name && item.last_name) user = item.first_name+' '+item.last_name;

	     						tr+='<tr>'
	     						+   '<td class="text-center">'+user+'</td>'
	     						+	'<td class="text-center">'+item.phone+'</td>'	
	                          	+	'<td class="text-center">'+item.balance+'</td>'	
	                          	+	'<td class="text-center">'+item.wechat+'</td>'	
	                          	+	'<td class="text-center">'+(item.address?item.address:'')+'</td>'	
	                          	+	'<td class="text-center">'+(item.zip?item.zip:'')+'</td>'	
	                            +   '<td class="text-center">'+item.email+'</td>'
	                            +   '<td class="text-center">'+(item.order_id?item.order_id:'')+'</td>'
	                            +   '<td class="text-center">'+(item.order_last?item.order_last:'')+'</td>'
	                            +   '<td class="text-center">'+item.cashier_name+'</td>'
	                            +	'<td class="text-center"><span class="count-btn detail-printer">打印</span></td>'
	                            +	'</tr>'
	                        });
	                        $('#member-detail tbody').html(tr); 
	                        if(parseInt(total)>1){
	                        	var pageHtml=paginate(total,page);
	                            $('#member-detail tfoot tr td').html(pageHtml);
	                        }else{
	                        	$('#member-detail tfoot tr td').html('');
	                        }
	            		}
	            	})
	            }
	            //2会员充值
	            var recharge_date='',recharge_page=1,recharge_total_page=1,rechargeArr=[];
	            getCharge()
	            $('body').on('click','#member-recharge .page-next',function(){
	                if (parseInt(recharge_page)+1 <= recharge_total_page) {
	                   recharge_page++;
	                   getCharge()
	                }
	            });
	            $('body').on('click','#member-recharge .page-prev',function(){
	                if (parseInt(recharge_page)-1 > 0) {
	                    recharge_page -= 1;
	                    getCharge()
	                }
	            });
	            $('body').on('click','#member-recharge .page-target',function(){
	                recharge_page = parseInt($(this).html());
	               getCharge()
	            });
	            //充值打印
	            $('body').on('click','#member-recharge .recharge-printer',function(){ 
	            	$('#printer').show().siblings().hide();
	               $('.print-recharge').show().siblings('.print-item').hide()
	            	var index=$(this).parents('tr').index();
	            	var item=rechargeArr[index];
	            	var paymode = SITE_CONFIG.pay_types[item.pay_type][SITE_LANG];
	            	var recharge_money=parseFloat(item.num)-parseFloat(item.recharge.present)
	            	
        			$('.print-recharge .cashier-name').html(item.cashier_name);
        			$('.print-recharge .recharge-time').html(item.create_time);
        			$('.print-recharge .print-recharge-payMode').html(paymode+'支付');
        			$('.print-recharge .recharge-name').html(item.user.username);
        			$('.print-recharge .recharge-weixin').html(item.user.wechat);
        			$('.print-recharge .recharge-phone').html(item.phone);
        			$('.print-recharge .last-balance').html(item.last);
        			$('.print-recharge .recharge-money').html((recharge_money).toFixed(2));
        			$('.print-recharge .present-money').html(item.recharge.present);
        			$('.print-recharge .now-balance').html(item.now);
	            	$('.print-recharge .print-time-detail').html(getTime());
	            	$('#printer').jqprint();
	            });
	            function getCharge(){
	            	var params={keyword:keyword,date:recharge_date,page:recharge_page}
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		data:params,
	            		url:urlHead+'/order/get_recharge',
	            		success:function(json){
	            			var page=json.current_page;
	                        var total=json.last_page;
	                        recharge_total_page = json.last_page;
	                        var page_size=json.page_size;
	                        
	                       rechargeArr=json.data;
	            			console.log(json)
	            			var tr=''
	            			$.each(json.data, function(index,item) {
	            			  var user = lang('COUNT_ORDER_USER');
	                          if(item.nickname) user = item.nickname;
	                          if(item.first_name && item.last_name) user = item.first_name+' '+item.last_name;
	                          var paymode = SITE_CONFIG.pay_types[Number(item.pay_type)][SITE_LANG];
	                          var recharge_money=parseFloat(item.num)-parseFloat(item.recharge.present)
	                          var desc='';
	                          tr+='<tr>'
	                          if(item.desc == 'reg'){
	                          	desc=lang('COUNT_VIP_REG')
	                         	tr+='<td class="text-center"><span class="new">'+desc+'</span></td>'
	                          }else{
	                          	desc=lang('COUNT_VIP_RECHARGE')
	                         	tr+='<td class="text-center"><span class="money">'+desc+'</span></td>'
	                          }
	     						
	     						tr+=   '<td class="text-center">'+user+'</td>'
	     						+	'<td class="text-center">'+item.phone+'</td>'	
	                          	+	'<td class="text-center">'+item.last+'</td>'	
	                          	+	'<td class="text-center">'+recharge_money+'</td>'
	                          	+	'<td class="text-center">'+item.recharge.present+'</td>'
	                          	+	'<td class="text-center">'+item.now+'</td>'	
	                          	+	'<td class="text-center">'+paymode+'</td>' 	  
	                            +   '<td class="text-center">'+item.create_time+'</td>'
	                            +   '<td class="text-center">'+item.cashier_name+'</td>'
	                            +	'<td class="text-center"><span class="count-btn recharge-printer" data-id="'+item.id+'">打印</span></td>'
	                            +	'</tr>'
	                        });
	                        $('#member-recharge tbody').html(tr); 
	                        if(parseInt(total)>1){
	                        	var pageHtml=paginate(total,page);
	                            $('#member-recharge tfoot tr td').html(pageHtml);
	                        }else{
	                        	$('#member-recharge tfoot tr td').html('');
	                        }
	            		}
	            	})
	            }
	            
	            //3会员退换货
	            var refund_date='',refund_page=1,refund_total_page=1,refundArr=[];
	            getRefund()
	            $('body').on('click','#member-refund .page-next',function(){
	                if (parseInt(refund_page)+1 <= refund_total_page) {
	                   refund_page++;
	                   getRefund()
	                }
	            });
	            $('body').on('click','#member-refund .page-prev',function(){
	                if (parseInt(refund_page)-1 > 0) {
	                    refund_page -= 1;
	                    getRefund()
	                }
	            });
	             $('body').on('click','.refund-check',function(){
					check(this)
	            })
	            $('body').on('click','#member-refund .page-target',function(){
	                refund_page = parseInt($(this).html());
	               getRefund()
	            });
	            
	            $('body').on('click','.refund-printer',function(){
	            	$('#printer').show().siblings().hide();
	            	$('.print-refund').show().siblings('.print-item').hide()
	            	var order=$(this).attr('data-order');
	            	var type=$(this).attr('data-type');
	            	console.log(order,type)
	            	if(type == 4){
	            		refundPrint(order)
	            	}else{
	            		orderPrint(order)	
	            	}
	            	
	            })
	            function getRefund(){
	            	var params={keyword:keyword,date:refund_date,page:refund_page}
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		data:params,
	            		url:urlHead+'/order/get_xiaofei',
	            		success:function(json){
	            			var page=json.current_page;
	                        var total=json.last_page;
	                        refund_total_page = json.last_page;
	                        var page_size=json.page_size;
	                       
	                       refundArr=json.data;
	            			console.log(json)
	            			var tr=''
	            			$.each(json.data, function(index,item) {
	            			
	            			  var user = lang('COUNT_ORDER_USER');
	                          if(item.nickname) user = item.nickname;
	                          if(item.first_name && item.last_name) user = item.first_name+' '+item.last_name;
	                          var paymode = SITE_CONFIG.pay_types[Number(item.pay_type)][SITE_LANG];
	                          tr+='<tr class="list-tr">'
	                          if(item.type == 0 || item.type == 1){
	                          	tr+='<td class="text-center"><span class="new">会员消费</span></td>'
	                          }else if(item.type == 4){
	                          	tr+='<td class="text-center"><span class="money">会员退款</span></td>'
	                          }
	                         
	     						tr+=   '<td class="text-center">'+user+'</td>'
	     						+	'<td class="text-center">'+(item.phone?item.phone:'')+'</td>'	
	                          	+	'<td class="text-center">'+item.last+'</td>'	
	                          	+	'<td class="text-center">'+item.num+'</td>'	
	                          	+	'<td class="text-center">'+(item.now?item.now:0)+'</td>'	
	                          	+	'<td class="text-center">'+item.desc+'</td>'	  
	                            +   '<td class="text-center">'+item.create_time+'</td>'
	                            +   '<td class="text-center">'+(item.cashier_name?item.cashier_name:CASHIER)+'</td>'
	                            +	'<td class="text-center"><span class="count-btn refund-check" data-order="'+item.relation_id+'" data-type="'+item.type+'">查看</span><span class="count-btn refund-printer" data-order="'+item.relation_id+'" data-type="'+item.type+'">打印</span></td>'
	                            +	'</tr>'
	                        });
	                        $('#member-refund tbody').html(tr); 
	                        if(parseInt(total)>1){
	                        	var pageHtml=paginate(total,page);
	                            $('#member-refund tfoot tr td').html(pageHtml);
	                        }else{
	                        	$('#member-refund tfoot tr td').html('');
	                        }
	            		}
	            	})
	            }
	            
	            // 退换货
	           	var return_date='',return_page=1,return_total_page=1;
	            getReturn()
	            $('body').on('click','#return-table .page-next',function(){
	                if (parseInt(return_page)+1 <= return_total_page) {
	                   return_page++;
	                   getReturn();
	                }
	            });
	            $('body').on('click','#return-table .page-prev',function(){
	                if (parseInt(return_page)-1 > 0) {
	                    return_page -= 1;
	                    getReturn();
	                }
	            });
	            $('body').on('click','#return-table .page-target',function(){
	                return_page = parseInt($(this).html());
	                getReturn();
	            });
	             $('body').on('click','.return-check',function(){
					check(this)
	            })
	             
	              $('body').on('click','.return-printer',function(){
	              	$('#printer').show().siblings().hide();
	            	$('.print-refund').show().siblings('.print-item').hide()
	            	var order=$(this).attr('data-order');
	            	var refund=$(this).attr('data-refund');
	            	refundPrint(order)
	            })
	            function getReturn(){
	            	var params={keyword:keyword,date:return_date,page:return_page}
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		data:params,
	            		url:urlHead+'/order/get_refunds',
	            		success:function(json){
	            			var page=json.current_page;
	                        var total=json.last_page;
	                        return_total_page = json.last_page;
	                        var page_size=json.page_size;
	                        var orders=json.data;
	                        
	            			console.log(json)
	            			var tr=''
	            			$.each(orders, function(index,item) {
	            			  var user = lang('COUNT_ORDER_USER');
	                          if(item.nickname) user = item.nickname;
	                          if(item.first_name && item.last_name) user = item.first_name+' '+item.last_name;
	                          var paymode = SITE_CONFIG.pay_types[0][SITE_LANG];
	                          if(item.pay_mode>0) paymode= SITE_CONFIG.pay_types[Number(item.pay_mode)][SITE_LANG]; 
	                          var product=item.product;
	                         
	                          	tr+='<tr class="list-tr">'
	                          	+   '<td class="text-center">'+item.order.order_id+'</td>'
	            			    +   '<td class="text-center ">'+item.create_time+'</td>'
	                            +    '<td class="text-center">'+user+'</td>'
	                            +    '<td class="text-center">'+paymode+'</td>'
	                            +    '<td class="text-center">'+item.money+'</td>'
	                            +    '<td class="text-center">'+(item.first_name?item.last:0)+'</td>'
	                            +    '<td class="text-center">'+(item.first_name?item.now:0)+'</td>'
	                            +    '<td class="text-center" >'+item.vat+'</td>'
	                            +    '<td class="text-center">'+(item.is_damaged==1 ? '是':'否')+'</td>'
	                            +   '<td class="text-center">'+item.cashier_name+'</td>'
	                            +	'<td class="text-center"><span class="count-btn return-check" data-order="'+item.order_id+'" data-type="'+item.type+'">查看</span><span class="count-btn return-printer" data-order="'+item.order_id+'" data-type="'+item.type+'">打印</span></td>'
	                            +	'</tr>'
	            			  
	            			});
	            			
	                        $('#return-table tbody').html(tr); 
	                        if(parseInt(total)>1){
	                        	var pageHtml=paginate(total,page);
	                            $('#return-table tfoot tr td').html(pageHtml);
	                        }else{
	                        	 $('#return-table tfoot tr td').html('');
	                        }
	            		}
	            	})
	            }
	            
	            //点击查看详情
	          	function check(ele){
	          		
	          		if($(ele).parents('.list-tr').next().hasClass('add-tr')){
						$(ele).parents('.check-list').find('.add-tr').remove();
						return;
					}
					if($(ele).parents('.list-tr').siblings().hasClass('add-tr')){
		            	$(ele).parents('.check-list').find('.add-tr').remove();
		            }
					
	            	var order=$(ele).attr('data-order');
	            	var type=$(ele).attr('data-type');
	            	var index=$(ele).parents('.list-tr').index();
	            	var target=$(ele).parents('.check-list').find('tbody .list-tr:eq('+index+')');
	            	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		url:urlHead+'/order/get_order/'+order,
	            		success:function(json){
	            			console.log(json)
	            			if($(ele).parents('.check-list').hasClass('return') || type==4){
	            				showRefundDetail({
	            					target:target,
			       					data:json,
			       					type:type
	            				})
	            			}else{
	            				showDetail({
				       				target:target,
				       				data:json,
				       			})
	            			}
	            			
	            		}
	            	})	
	         	 }
	            //查看详情
	            function showDetail(options){
	            	var html='';
	            	var counts=0;
	            	html+='<table class="detail" border="none" cellpadding="0" cellspacing="0"><thead><tr><td>序号</td><td>商品名称</td><td>单价</td><td>数量</td><td>消费金额</td><td>VAT</td></tr></thead>'
						+'<tbody>';
						$.each(options.data.items,function(index,list){
							counts+=Number(list.qty)
							html+='<tr>'
							+	'<td>'+(index+1)+'</td>'
							+	'<td>'+list.product.title+'</td>'
							+	'<td>'+list.price+'</td>'
							+	'<td>'+list.qty*1+'</td>'
							+	'<td>'+list.total+'</td>'
							+	'<td>'+(list.item?(list.item.vat*list.qty*1).toFixed(2):0)+'</td>'
							+'</tr>';
						})
							
							
							html+='</tbody><tfoot><tr style="color:#333"><td>共计</td><td></td><td></td>'
							+'<td>'+(counts*100/100)+'</td>'
							+'<td>'+options.data.order.total+'</td>'
							+'<td>'+options.data.order.vat+'</td>'
						+'</tr></tfoot>'
					+'</table>';
					
	            	 var tr = $('<tr class="add-tr"><td></td></tr>');
					  var colspan = $(options.target).children().length;
					  tr.find('td').attr('colspan', colspan);
					  tr.find('td').addClass('text-l');
					  tr.find('td').html(html);
					  $(options.target).after(tr);
	            }
	            
	             function showRefundDetail(options){
	            	var html='';
	            	var counts=0;
	            	var vats=0;
	            	var damageds=0
	            	html+='<table class="detail" border="none" cellpadding="0" cellspacing="0"><thead><tr><td>序号</td><td>商品名称</td><td>单价</td><td>退款数量</td><td>退款金额</td><td>VAT</td><td>是否货损</td><td>退换货</td><td>货损数量</td></tr></thead>'
						+'<tbody>';
						var refunds=options.data.refunds;
						
						$.each(refunds,function(index,list){
							if(list.is_damaged == 1){
								damageds+=Number(list.qty);
							}
							if(list.money>0){
								vats+=Number(list.vat)*Number(list.qty);
								counts+=Number(list.qty)
							}
							html+='<tr>'
								+	'<td>'+(index+1)+'</td>'
								+	'<td>'+list.title+'</td>'
								+	'<td>'+list.price+'</td>'
								+	'<td>'+(list.money>0?list.qty*1:0)+'</td>'
								+	'<td>'+list.money+'</td>'
								+	'<td>'+(list.money>0?(list.vat*list.qty*1).toFixed(2):0)+'</td>'
								+	'<td>'+(list.is_damaged==1?'是':'否')+'</td>'
								+	'<td>'+(list.type==0?'退货':'换货')+'</td>'
								+	'<td>'+(list.is_damaged==1?list.qty*1:0)+'</td>'
								+'</tr>';
							
						})
							
							html+='</tbody><tfoot><tr style="color:#333"><td>共计</td><td></td><td></td>'
							+'<td>'+counts+'</td>'
							+'<td>'+(options.data.order.refund_fee)+'</td>'
							+'<td>'+vats.toFixed(2)+'</td>'
							+'<td></td>'
							+'<td></td><td>'+(damageds*100/100)+'</td>'
						+'</tr></tfoot>'
					+'</table>';
					
	            	 var tr = $('<tr class="add-tr"><td></td></tr>');
					  var colspan = $(options.target).children().length;
					  tr.find('td').attr('colspan', colspan);
					  tr.find('td').addClass('text-l');
					  tr.find('td').html(html);
					  $(options.target).after(tr);
	            }
	             
	             function refundPrint(order){
	             	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		url:urlHead+'/order/get_order/'+order,
	            		success:function(json){
	            			console.log(json)
	            			var order=json.order_refund[0];
	            			 var paymode = SITE_CONFIG.pay_types[order.pay_mode][SITE_LANG];  
	            			$('.print-refund .cashier-name').html(json.cashier.username);
	            			$('.print-refund .refund-time').html(order.create_time);
	            			$('.print-refund .refund-id').html(json.order.order_id);
	            			$('.print-refund .print-refund-payMode').html(paymode+'退款');
	            			var food=''
	            			var count=0;
	            			var vats=0;
	            			var damageds=0;
	            			$.each(json.refunds,function(index,list){
	            				$.each(json.items,function(i,item){
									if(item.item_id==list.item_id){
										list.item=item.item;
										list.product=item.product
									
										count+=Number(list.qty);
										if(list.is_damaged == 1){
											damageds+=Number(list.qty);
										}
										if( list.money>0){
											vats+=Number(list.item.vat)*Number(list.qty);
											console.log(vats,(list.money>0))
										}
			            				food+='<div class="print-table-list">'
											+'<div class="print-food">'+(index+1)+'.'+item.product.title+'</div>'
											+'<div class="print-food-detail">'
											+	'<span>'+item.price+'</span>'
											+	'<span>'+item.qty+'</span>'
											+	'<span>'+(list.is_damaged==0?'否':'是')+'</span>'
											+	'<span>'+item.total+'</span>'
											+'</div>'
										+'</div>'
									}
								})
	            			})
	            			$('.print-refund .print-table-body').html(food);
	            			$('.print-refund .print-table-total-food').html(count.toFixed(2));
	            			$('.print-refund .print-table-total-price').html(order.money);
	            			$('.print-refund .print-remark').html(json.refunds[0].remark);
	            			if(json.user){
	            				var user=json.user;
	            				$('.print-refund .vip-name').html(user.username);
	            				$('.print-refund .vip-weixin').html(user.wechat);
	            				$('.print-refund .vip-address').html((user.address?user.address:''));
	            				$('.print-refund .vip-zip').html(user.zip);
	            				$('.print-refund .vip-phone').html(user.phone);
	            			}else{
	            				$('.print-refund .vip-name-box').html('联系姓名：');
	            			}
	            			
	            			var consumption='';
	            			consumption+='<div class="print-list" >退款金额：'+order.money+'</div>'
							+'<div class="print-list" >'+paymode+'退款：'+order.money+'</div>'		
							if(order.pay_mode == 0){
								consumption+='<div class="print-list" >上次余额：'+order.last+'</div>'
								consumption+='<div class="print-list" >当前余额：'+order.now+'</div>'
							}
							consumption+='<div class="print-list" >货损数量：'+damageds+'</div>'
	            			$('.consumption').html(consumption);
	            			var vatNet=Number(order.money)-Number(order.vat)
	            			$('.print-refund .vat-net').html(vatNet.toFixed(2));
	            			$('.print-refund .vat-20').html(order.vat);
	            			$('.print-refund .vat-gross').html(order.money);
	            			$('.print-time-detail').html(getTime())
	            			$('#printer').show().siblings().hide();
	            			$('.print-refund').show().siblings('.print-item').hide();
	            			$('#printer').jqprint();
	            		}
	            	})	
	            }
	             
	             function orderPrint(order){
	             	$.ajax({
	            		type:'GET',
	            		dataType:'json',
	            		url:urlHead+'/order/get_order/'+order,
	            		success:function(json){
	            			console.log(json)
	            			if(json.cashier){
	            				 $('#printer .offline').show();
	            				 $('#printer .online').hide();
	            			}else{
	            				$('#printer .offline').hide();
	                			$('#printer .online').show();
	                			var deliveryTime=json.order.shipping_date+' '+json.order.shipping_time;
	                			$('.print-order .delivery-time').html(deliveryTime);
	            			}
	            			 var paymode = SITE_CONFIG.pay_types[0][SITE_LANG];
	                          if(json.order.money == 0) paymode = '';
	                          if(json.order.pay_mode>0) paymode+= SITE_CONFIG.pay_types[json.order.pay_mode][SITE_LANG];
	                          var cashierName=json.cashier?json.cashier.username:CASHIER;
	                       
	            			$('.print-order .cashier-name').html(cashierName);
	            			$('.print-order .order-time').html(json.order.create_time);
	            			$('.print-order .order_id').html(json.order.order_id);
	            			$('.print-order .print-order-payMode').html(paymode+'支付');
	            			var list=''
	            			var count=0;
	            			$.each(json.items,function(index,item){
	            				count+=Number(item.qty);
	            				list+='<div class="print-table-list">'
									+'<div class="print-food">'+(index+1)+'.'+item.product.title+'</div>'
									+'<div class="print-food-detail">'
									+	'<span>'+item.price+'</span>'
									+	'<span>'+item.qty+'</span>'
									+	'<span>'+item.total+'</span>'
									+'</div>'
								+'</div>'
	            			})
	            			$('.print-order .print-table-body').html(list);
	            			$('.print-order .print-table-total-food').html(count.toFixed(2));
	            			$('.print-order .print-table-total-price').html(json.order.total);
	            			if(json.user){
	            				var user=json.user;
	            				$('.print-order .vip-name').html(user.username);
	            				$('.print-order .vip-weixin').html(user.wechat);
	            				$('.print-order .vip-address').html((user.address?user.address:''));
	            				$('.print-order .vip-zip').html(user.zip);
	            				$('.print-order .vip-phone').html(user.phone);
	            			}else{
	            				$('.print-order .vip-name-box').html('联系姓名：');
	            			}
	            			var consumption='';
	            			consumption+='<div class="print-list" >消费金额：'+json.order.total+'</div>'
									+'<div class="print-list" >优惠金额：'+json.order.cut_fee+'</div>'
							
							if(json.order.user_id > 0){
								consumption+='<div class="print-list" >会员支付：'+json.order.money+'</div>'
								if(json.order.pay_fee>0){
									consumption+='<div class="print-list" >'+SITE_CONFIG.pay_types[json.order.pay_mode][SITE_LANG]+'支付：'+json.order.pay_fee+'</div>'
								}	
								consumption+='<div class="print-list" >上次余额：'+json.order.last+'</div>'
											+'<div class="print-list" >当前余额：'+json.order.now+'</div>'
							}else{
								consumption+='<div class="print-list" >'+paymode+'支付：'+json.order.pay_fee+'</div>'
							}
									
	            			$('.consumption').html(consumption);
	            			
	            			var vatNet=parseFloat(json.order.total)-parseFloat(json.order.cut_fee)-parseFloat(json.order.vat);
	            			var vatGross=parseFloat(json.order.total)-parseFloat(json.order.cut_fee);
	            			$('.print-order .vat-net').html(vatNet.toFixed(2));
	            			$('.print-order .vat-20').html(json.order.vat);
	            			$('.print-order .vat-gross').html(vatGross.toFixed(2));
	            			$('.print-time-detail').html(getTime())
	            			$('#printer').show().siblings().hide();
	            			$('.print-order').show().siblings('.print-item').hide();
	            			$('#printer').jqprint();
	            		}
	            	})
	             }
        })
    </script>
</body>
</html>